package com.itheima.server.interceptor;

import com.tanhua.model.domain.User;

public class UserHolder {

    private  static ThreadLocal<User> threadLocal = new ThreadLocal<User>();

    public static void set(User user){
        threadLocal.set(user);
    }

    public static User get(){
        return threadLocal.get();
    }

    public static Long getId(){
        return get().getId();
    }

    public static String getMobile(){
        return get().getMobile();
    }


}
